var webpack = require('webpack');
//var commonsPlugin = new webpack.optimize.CommonsChunkPlugin('common.js');

// 辅助函数
// var utils = require("./utils");
// var fullPath = utils.fullPath;
// var pickFiles = utils.pickFiles;

// 项目根路径
// var ROOT_PATH = fullPath("/");
// 项目源码路径
// var SRC_PATH = ROOT_PATH + "/scripts";
// 产出路径
// var DIST_PATH = ROOT_PATH + "dist/js/page";

module.exports = {
    //context: '../',
    // 入口文件配置
    entry: {
        greeting: './scripts/components/greeting.js',
        clock: './scripts/components/clock.js',
        index: './scripts/pages/index.js',
        'tic-tac-toe': './scripts/pages/tic-tac-toe.js',
        temperature: './scripts/pages/temperature.js',
        commentList: './scripts/pages/comment/list.js',
    },
    // 输出文件配置
    output: {
        path: './dist/js/page',
        filename: '[name].bundle.js'
    },
    module: {
        // 加载器配置
        loaders: [
            {test: /\.js$/, loader: 'jsx-loader?harmony'}
        ]
    },
    resolve: {
        //root: "D:/GitHub/JavaWebDemo/DemoWeb/src/main/webapp",
        // 自动扩展文件后缀名，意味着我们require模块可以省略不写后缀名
        extensions: ['', '.js', '.json', '.jsx']
    },
    plugins: [
        // new webpack.optimize.UglifyJsPlugin({
        //     compress: {
        //         warnings: false
        //     }
        // })
    ]
};